package confInfo;

import java.util.*;

public final class Constants {
	public enum level{
		start_url,
		rule,
		level1,
		level2,
		level3,
		item
	}
	
	public final String PROJECT_NAME = "webScrapy";
	
	public final String PROJECT_BASE = "E:\\workplace\\jsp_workplace\\xml";
	public final String FILE_BASE = PROJECT_BASE + "\\webScrapy\\webScrapy\\";
	public final String SPIDER_FILE = FILE_BASE + "spiders\\spider.py";
	public final String SETTING_FILE = FILE_BASE + "settings.py";
	public final String PIPELINES_FILE = FILE_BASE + "pipelines.py";
	public final String ITEMS_FILE = FILE_BASE + "items.py";
	
	public final String CREATE_PROJECT_BAT = PROJECT_BASE + "\\creatProject.bat";
	public final String RUN_SCRAPY_BAT = PROJECT_BASE + "\\startCrawl.bat";
	
	public String status = "waiting...";
	
	private static String[] fileNames = {"file1", "file2", "file3"};
	final static public int levelCount = 6;
	public static HashMap<level, String> levelMap = new HashMap<level, String>();
	public static ArrayList<String> levels = new ArrayList<String>();
	static{
		for(level l:level.values() ){
			int i = 0;
			levels.add(l.toString());
			levelMap.put(l, fileNames[i++]);
		}
	}
	public static String getLevel(int i){
		return levels.get(i-1);
	}
	public ArrayList<String> getLevels(){
		return levels;
	}
	public static int getLevelCount(){
		return levelCount;
	}
	
	public static void main(String argv[]){
		System.out.println(levelMap);
	}
	
	public String getStatus(){
		return status;
	}
}
